from pyecharts.charts import Geo
from pyecharts import options as opts
from pyecharts.globals import GeoType


if __name__ == '__main__':
    g = Geo()
    g.add_schema(maptype="china")
    g.add_coordinate('Rad1',116.41667,39.91667)
    g.add_coordinate('Rad2',121.43333,34.50000)
    g.add_coordinate('Rad3',117.20000,39.13333)
    g.add_coordinate('Rad4',114.10000,22.20000)

    # 给上面的坐标点添加数据
    data_pair = [('Rad1','Rad1'),('Rad2','Rad2'),('Rad3','Rad3'),('Rad4','Rad4')]

    # 将数据添加到定义的地图上
    g.add('',data_pair,type_=GeoType.EFFECT_SCATTER,symbol_size=5)
    # 设置样式
    g.set_series_opts(label_opts=opts.LabelOpts(is_show=True))

    g.render('hao.html')
